<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>分页查询图书信息</title>
        <link rel="stylesheet" href="statics/bootstrap/css/bootstrap.css">
<%--    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">--%>
</head>
<body class="container">
<h1>分页查询图书信息</h1>
<table class="table table-bordered table-hover">
    <tr>
        <th>编号</th>
        <th>书名</th>
        <th>操作</th>
    </tr>
    <c:if test="${not empty requestScope.pagerInfo.dataList}">
        <c:forEach items="${requestScope.pagerInfo.dataList}" var="b">
            <tr>
                <td>${b.id}</td>
                <td>${b.title}</td>
                <td><a href="#" class="btn btn-danger btn-xs">删除</a></td>
            </tr>
        </c:forEach>
    </c:if>
    <tfoot>
    <tr bgcolor="#7fffd4">
        <td colspan="3" align="center">
            第${requestScope.pagerInfo.pageIndex}页
            |共${requestScope.pagerInfo.totalPage}页
            |共${requestScope.pagerInfo.totalCount}条
        </td>
    </tr>
    <tr>
        <td colspan="3" align="center">
            <c:if test="${requestScope.pagerInfo.pageIndex>1}">
                <a class="btn btn-info btn-sm" href="book?pageIndex=1">首 页</a>
                <a class="btn btn-info btn-sm" href="book?pageIndex=${requestScope.pagerInfo.pageIndex-1}">上一页</a>
            </c:if>
            <c:if test="${requestScope.pagerInfo.pageIndex<requestScope.pagerInfo.totalPage}">
                <a class="btn btn-info btn-sm" href="book?pageIndex=${requestScope.pagerInfo.pageIndex+1}">下一页</a>
                <a class="btn btn-info btn-sm" href="book?pageIndex=${requestScope.pagerInfo.totalPage}">尾 页</a>
            </c:if>
        </td>
    </tr>

    </tfoot>

</table>
</body>
</html>
